import HttpThread.HttpThread;
import Utils.LoadClassBean;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class TcpServer {
    volatile static int sum = 0;
    public static void main(String[] args) throws IOException {
        ServerSocket serverSocket = new ServerSocket(5678,50);
        serverSocket.setReuseAddress(true);
        LoadClassBean.run();
        System.out.println("预备：");
        System.out.println(serverSocket.getLocalSocketAddress());
        do {
            Socket socket = serverSocket.accept();
            HttpThread httpThread = new HttpThread(socket);
            new Thread(httpThread).start();
        }while (true);
    }
}
